package com.heima.apuser.feignHeaderInterceptor;

import com.heima.utils.common.WmThreadLocalUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

@Component
public class FeignHeaderInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("userId", WmThreadLocalUtil.get() + "");
    }
}
